/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.appleframework.exceptions;

import java.util.concurrent.atomic.AtomicLong;

/**
 *
 * @author zhujg
 */
public abstract class AppleException extends RuntimeException {

  static AtomicLong atomicLong = new AtomicLong(System.currentTimeMillis());
  String id;

  public AppleException() {
    super();
  }

  public AppleException(String message) {
    super(message);
  }

  public AppleException(String message, Throwable cause) {
    super(message, cause);
  }

  void setId() {
    long nid = atomicLong.incrementAndGet();
    id = Long.toString(nid, 26);
  }

  public abstract String getErrorTitle();

  public abstract String getErrorDescription();

  public Integer getLineNumber() {
    return -1;
  }

  public String getSourceFile() {
    return "";
  }

  public String getId() {
    return id;
  }
}
